home *** CD-ROM | disk | FTP | other *** search
/ SysOp's Arsenal / SysOp's Arsenal 1 (Arsenal Computer).ISO / telecom / sfnet.slt < prev    next >
Text File  |  1994-09-02  |  12KB  |  230 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //      SFNET.SLT ... SPITFIRE SFNET Upload/Download Script
  4. //
  5. //         Although there's a lot of comments to this, compiled it still only
  6. //        takes up just over 1K. So try not to change or remove anything not
  7. //        documented, in order to prevent possible errors. The "//" are
  8. //        especially important, don't remove them unless you remove the
  9. //        entire line AND ONLY THEN WITH CARE.
  10. //
  11. //            Your personal data must be entered in areas marked with
  12. //              ** in the comment fields. Make sure you keep your 
  13. //              data between the quotation marks.
  14. //
  15. //        ***** You MUST enter your BIRTH DATE in the TELIX
  16. //        ***** BBS dir as a password i.e mmddyy, just numbers
  17. //              no hypens or quotes. Trust me on this one.
  18. //
  19. //        ** This script will *only* work with ZMODEM and Spitfire as a HUB
  20. //
  21. //       If you follow the comments exactly you should have no problems
  22. //
  23. //         AFTER ALL CHANGES ARE MADE COMPILE USING "CS SFNET"
  24. //                                
  25. //
  26. //                 Originally written by Dan South, AUG 1990
  27. ///////////////////////////////////////////////////////////////////////////////
  28.  
  29. ///////////////////////////////////////////////////////////////////////////////
  30. //
  31. // Here is where your own information goes. Some data will need to be changed
  32. // in the MAIN part of the Script, follow the comments exactly and you'll be
  33. // just fine
  34. ///////////////////////////////////////////////////////////////////////////////
  35.  
  36.                                            ////////////////////////////////////
  37.                                           //////////
  38. str user_name[] = "A0515000^M^MJACQUE_SHIPLEY", // ** ENTER your name;password
  39.                                          ///////// You must use your password -
  40.                                         //       name as shown for this to work
  41.                                        //
  42.                                       //
  43.                                       //
  44.     dial_str[]="27",                 // ** ENTER the Telix Dialing Directory
  45.                                     //     number of the BBS to call
  46.                                     //
  47.     graph_str[]="N";                // ** CHANGE to "y" if you want Graphics
  48.                                     //
  49.                                     //
  50.     int d = 1,                      // ** CHANGEABLE delay time to answer
  51.                                     // the SPITFIRE prompt. Range from
  52.                                     // 1 to 30, 10 = 1 second. This works
  53.                                     // well, so change it only if you
  54.                                     // must.
  55.                                     //
  56.     e = 9600;                       // ** CHANGEABLE time the script will
  57.                                     // wait while in the Hub's Relay
  58.                                     // door for your packet to be
  59.                                     // assembled after you upload
  60.                                     // your.rly file. 10 = 1 sec.
  61.                                     //
  62. str capfilename[] = "c:\telix\mail.cap";    // Screen capture of mail run
  63.                                     // can be used for debugging or keeping
  64.                                     // record of activity - comment out if
  65.                                     // you do not wish to use this feature
  66.                                     ///////////////////////////////////////////
  67.  
  68. ///////////////////////////////////////////////////////////////////////////////
  69. //
  70. //  Read the comments and enter the changes exactly as described. Otherwise   
  71. //   unpredictable results may occur.
  72. ///////////////////////////////////////////////////////////////////////////////
  73. //
  74. //
  75. ///////////////////////////////////////////////////////////////////////////////
  76. // 
  77. // This is the main body of the script.
  78. //
  79. ///////////////////////////////////////////////////////////////////////////////
  80.                                         //
  81. main()                                  //
  82. {
  83.  
  84.  slug();                                // call function slug()
  85.                                         //
  86. int tmark;                              //
  87.                                         // ************************************
  88.  ///////////////////////////////////////// DON'T CHANGE ANYTHING BUT THE NUMBER
  89. //                                         ************************************
  90. dial(dial_str, 100, 1);                 // ** dial the BBS X number of attempts
  91. // Change this  ^ to desired redial attempts, The number of tries is determined
  92.  ///////////////////////////////////////// by the first number. (currently 100)
  93.                                         //  by setting to 0 it will redial
  94.                                         //        until connected 
  95.   if (!carrier())                       // ->  Shut Down the Script/Telix
  96.    {                                   /////// If no connection after X Redial
  97.       clear_scr();                          //// Attempts
  98.       pstraxy("Log-on Failed!", 28, 4, 750); //
  99.       pstraxy("Returning Control back to Spitfire in 5 . 4 . 3 . 2 . 1", 10, 5, 750);                                       // 
  100.       delay(50);                            // 
  101.       timer_free(tmark);                    // free timer channel
  102.       track_free(0);                        // and all track channels
  103.       hangup();                             //
  104.       exittelix(1,1);                       //    The Script Continues
  105.    }                                        // If connection is made before end
  106.                                             //   of redial setting is reached
  107.                                              //
  108.    int cst;
  109.    cst = capture_stat ();                        // check capture status
  110.    
  111.    if (cst == 1)                                 // close capture if open
  112.     {
  113.      capture("*CLOSE*");
  114.     }
  115.  capture(capfilename);
  116.  
  117.  int stat;                              // set up a bunch of variables
  118.  int t1,                                //
  119.      t2,                                //
  120.      t3,                                //
  121.      t4,                                //
  122.      t5,                                //
  123.      t6;                                //  
  124.                                         //
  125.  t1 = track("GRAPHICS?", 0);            // define the variables
  126.  t2 = track("first name", 0);           //
  127.  t3 = track("birth date", 0);           //////    
  128.  t4 = track("< ENTER >", 0);               //     
  129.  t5 = track("stati", 0);                  //
  130.  t6 = track("ENTER COMMAND", 0);          //
  131.   tmark = timer_start(1800);             // wait up to 3 minutes      
  132.                                         // before hanging up if no 
  133.                                         // activity is detected
  134.                                         //
  135.                                         //
  136.  while (not time_up(tmark))             // as long as things are happening
  137.                                         // and time is not up
  138.   {                                     //
  139.    terminal();                          // let Telix process any chars and keys
  140.                                         //
  141.                                         //
  142.    stat = track_hit(0);                 // see which (if any) track was hit
  143.                                         //
  144.    if (stat == t1)                      // say whether we want graphics
  145.     {                                   //
  146.      delay(d);                          //
  147.      cputs(graph_str);                  // send answer
  148.     }                                   //
  149.    else if (stat == t2)                 // send name
  150.     {                                   //
  151.      track_free(t1);                    // free the track, we won't
  152.                                         // need it again
  153.      delay(d);                          //
  154.      cputs(user_name);                  //
  155.      cputs("^M");                       //
  156.     }                                   //
  157.    else if (stat == t3)                 // send second password - birth date 
  158.     {                                   //  you remembered right?
  159.      track_free(t2);                    // free the track, we won't
  160.                                         // need it again
  161.      delay(d);                          //
  162.      cputs(_entry_pass);                // uses the birth date from the
  163.                                         // dialing directory password entry
  164.     }                                   //
  165.    else if (stat == t4)                 // Moving along....
  166.     {                                   //
  167.      delay(d);                          //
  168.      cputs("^M");                       //
  169.     }                                   //
  170.    else if (stat == t5)                 // "No" Message checking, we'll most
  171.     {                                   //   likely get em anyway in the D/L
  172.      delay(d);                          //
  173.      cputs("N^M");                      //
  174.     }                                   //
  175.    else if (stat == t6)                 //   
  176.     {                                   //
  177.      delay(d);                          // Select A from the SF Menu extension
  178.      cputs("A^M");                      // to receive packet
  179.       Delay(10);                        // 
  180.       receive('Z',"A0515000.QWK");      //  ** Change to reflect the Hub ID
  181.       waitfor ("A B Q G",e);            //  packet name of your Hub
  182.       cputs("B^M");                     //  Select B from the SF Menu extension
  183.       delay(d);                         //  to upload reply packet
  184.       send('Z',"A0515000.REP");         //  **  Change so the REP packet has
  185. //    delay(20);                        //  the HUB ID of your hub
  186.       waitfor ("A B Q G",e);            //  
  187.       cputs("G^M");                     //  All done...say Goodbye
  188.       waitfor ("Are you",1);            //
  189.       cputs("Y",0);                     // 
  190.       capture( "*CLOSE*" );             //  Close capture file
  191.      hangup();                          //  
  192.      exittelix(1,1);                    //  Exit Telix
  193.     }                                   //   * END OF CHANGES TO MAKE *
  194.   }                                     //
  195.  if (time_up(1))                        //
  196.   {                                     // 
  197.   clear_scr();                          //
  198.   pstraxy("Log-on Failed!", 28, 4, 700); //
  199.   pstraxy("Returning Control back to Spitfire in 5 . 4 . 3  2 . 1", 10, 5, 700);   timer_free(tmark);                    // free timer channel
  200.   track_free(0);                        // and all track channels
  201.   hangup();                             //
  202.   exittelix(1,1);                       //
  203.   }                                     //
  204. }                                       //
  205.                                         //
  206. ///////////////////////////////////////////////////////////////////////////////
  207.  
  208. ///////////////////////////////////////////////////////////////////////////////
  209. // Function slug.                                                          
  210. ///////////////////////////////////////////////////////////////////////////////
  211.  
  212. slug()                                  // function slug
  213. {
  214.  prints("^M");
  215.  prints("^M");
  216.  prints("^M");
  217.  prints("^M");
  218.  clear_scr();
  219.  pstraxy("***************************************************************", 8, 1, 27);
  220.  pstraxy("*       SFNET.SLT SPITFIRE-SFNET Upload/Download Script       *", 8, 2, 27);
  221.  pstraxy("*        Original Script (SFRIME3.SLT) By Dan South           *", 8, 3, 27);
  222.  pstraxy("*            Modified For SFNET By Jacque Shipley             *", 8, 4, 27);
  223.  pstraxy("***************************************************************", 8, 5, 27);
  224.  prints("^M");
  225.  return;
  226. }
  227.  
  228. ///////////////////////////////////////////////////////////////////////////////
  229. ///////////////////////////////////////////////////////////////////////////////
  230.